#pragma once
#include "RedBlackTree.h"

namespace myset
{
	template<class K>
	class  set
	{
	public:
		struct SetofKey
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
		typedef typename RBTree<K, K, SetofKey>::Iterator iterator;
		typedef typename RBTree<K, K, SetofKey>::Const_Iterator const_iterator;
	private:
		typedef RBTree<K, K, SetofKey> RB_Tree;
	public:
		iterator begin() 
		{
			return _t.Begin();
		}
		iterator end() 
		{
			return _t.End();
		}
		const_iterator begin() const
		{
			return _t.Begin();
		}
		const_iterator end() const
		{
			return _t.End();
		}
		pair<iterator, bool> insert(const K& key)
		{
			return _t.insert(key);
		}
		
		void inorder()
		{
			_t.InOrder();
			cout << endl;
		}

	private:
		RB_Tree _t;
	};
}